//
//  ZBSlideMemuMangerConfiguration.m
//  ZBSlideMemuManger
//
//  Created by apple on 2018/5/31.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "ZBSlideMemuMangerConfiguration.h"

@implementation ZBSlideMemuMangerConfiguration
+ (instancetype)defaultConfiguration
{
   return [ZBSlideMemuMangerConfiguration configurationWithDistance:kZBSCREENWIDTH *0.75 maskAlpha:0.3 scaleY:1.0 direction:ZBDrawerTransitionDirection_Left backImage:nil];
}
+ (instancetype)configurationWithDistance:(float)distance maskAlpha:(float)alpha scaleY:(float)scaleY direction:(ZBDrawerTransitionDirection)direction backImage:(UIImage *)backImage
{
    return [[ZBSlideMemuMangerConfiguration alloc]initWithDistance:distance maskAlpha:alpha scaleY:scaleY direction:direction backImage:backImage];
}
- (instancetype)initWithDistance:(float)distance maskAlpha:(float)alpha scaleY:(float)scaleY direction:(ZBDrawerTransitionDirection)direction backImage:(UIImage *)backImage
{
    if(self = [super init]){
        _distance = distance;
        _maskAlpha = alpha;
        _direction = direction;
        _backImage = backImage;
        _scaleY = scaleY;
        _finishPercent = 0.4;
        _showAnimDuration = 0.25;
        _HiddenAnimDuration = 0.25;
    }
    return self;
}
- (float)distance {
    if (_distance <= 0)
        return kZBSCREENWIDTH * 0.75;
    return _distance;
}

- (float)maskAlpha {
    if (_maskAlpha <= 0)
        return 0.4;
    return _maskAlpha;
}

- (float)scaleY {
    if (_scaleY <= 0)
        return 1.0;
    return _scaleY;
}

- (float)finishPercent {
    if (_finishPercent <= 0)
        return 0.4;
    return _finishPercent;
}

- (NSTimeInterval)showAnimDuration {
    if (_showAnimDuration <= 0)
        return 0.25;
    
    return _showAnimDuration;
}

- (NSTimeInterval)HiddenAnimDuration {
    if (_HiddenAnimDuration <= 0)
        return 0.25;
    
    return _HiddenAnimDuration;
}

@end

NSString *const ZBSlideMemuSlideAnimatorKey;
NSString *const ZBSlideMemuSlideMaskViewKey;
NSString *const ZBSlideMemuSlideInterativeKey;

NSString *const ZBSlideMemuSlidePanNoticationKey;
NSString *const ZBSlideMemuSlideeTapNoticationKey;

NSString *const ZBSlideMemuSlideDirectionKey;
